package util;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

public class TestUtil {
    public static String readFileString(String path) throws Exception{
        String sysPath = System.getProperty("user.dir") + File.separator + "src" + File.separator + "main" + File.separator + "resources";
        String fileName = sysPath + path;
        File jsonFile = new File(fileName);
        InputStreamReader reader = new InputStreamReader(new FileInputStream(jsonFile), "utf-8");
        int ch = 0;
        StringBuilder sb = new StringBuilder();
        while ((ch = reader.read()) != -1) {
            sb.append((char) ch);
        }
        reader.close();
        return sb.toString();
    }

}
